package com.example.sdbtspringboot.exception;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Description: service异常
 * @Author: cao
 * @Date: 2024/5/26 23:01
 */

@Data
public class ServiceException extends RuntimeException{

    private final String code;

    public ServiceException(String msg){
        super(msg);
        this.code="500";//默认500
    }

    public ServiceException(String code,String msg){
        super(msg);
        this.code=code;//自定义
    }


}
